﻿<!DOCTYPE html>
<html><head>
  <title>Pos 关键字</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=8">
  <meta name="generator" content="Help &amp; Manual">
  <meta name="keywords" content="OpenType Layout Features,OpenType Layout Features Pos">
  <meta name="description" content="The pos keyword declares a glyph positioning.As explained in the supported glyph positioning types there are several positioning types. Positioning declarations can onlybe...">
  <link type="text/css" href="default.css" rel="stylesheet">
  <link type="text/css" href="custom.css" rel="stylesheet">
  <style type="text/css" media="screen">
      html,body { margin:0;
        padding:0;
       background: #ffffff;
      }
      div#printheader { display: none; }
      #idheader {
        width:100%;
        height:auto;
        padding: 0;
        margin: 0;
        position: fixed;
        top: 0;
        z-index: 2;
      }
      /* The "min-height" for "#idheader table" ensures that the (blue) header of the topic
         has at least the same height as the header of the navigation panel left of it */
      #idheader table {background: #2C5D88; min-height: 59px }
      #idheader h1 span { color: #FFF }
      #idnav {
        text-align: right;
        width: 126px;
        vertical-align: middle;
      }
      #idnav a { text-decoration: none }
      #idnav span {
        display: inline-block;
        width: 24px;
        height: 24px;
        margin-left: 4px;
       background:url('hm_webhelp_buttons_grey.png') top left no-repeat;
      }
      #idnav a span {
       background-image:url('hm_webhelp_buttons_white.png');
      }
      #idnav a span:hover {
       background-image:url('hm_webhelp_buttons_orange.png');
      }
      #idnav span.hmbtnprev {background-position: 0 -32px }
      #idnav span.hmbtnnext {background-position: -24px -32px }
      #idnav span.hmbtntop  {background-position: -48px -32px }
      #idnav span.hmbtntoggle  { width: 20px;background-position: -70px -32px }
      #idnav span.hmbtnprint  {background-position: -88px -32px }
      #callout-table, #overview-table {display:block; position:relative; top:0; left:0;}
      #callout-icon {display:block; position:absolute; top:-11px; left:-11px;}
      #callout-icon-flag {display:block; position:absolute; top:-11px; left:-8px;}
      #callout-table a {text-decoration: none; color:blue;}
      #callout-table a:visited {text-decoration: none; color:blue;}
      #overview-table a {text-decoration: none; color:black;}
      #overview-table a:visited {text-decoration: none; color:black;}
      #callout-table a:hover, #overview-table a:hover {text-decoration: underline;}
      p.help-url { margin: 20px 0 5px 0; text-align: center; font-size: 80%; text-decoration: none }
      #switchtoggles { text-align: right; padding: 0 2px 0 0; font-size: 90%; }
      .sync-toc { color: #FFF; font-size: 8pt; font-weight:bold; display: none; }
      .sync-toc a { color: #FFF; text-decoration: none; font-weight:bold;}
      .sync-toc a:visited { color: #FFF; }
      .sync-toc a:hover { text-decoration: underline; }
      a.hmanchor { display: inline-block; margin-top: -4em; padding-top: 4em }	
  </style>
  <style type="text/css" media="print">
      div#idheader, img.dropdown-toggle-icon, p.help-url { display:none }
  </style>
  <script type="text/javascript" src="jquery.js"></script>
  <script type="text/javascript" src="helpman_settings.js"></script>
  <script type="text/javascript" src="helpman_topicinit.js"></script>
</head>
<body>
<div id="printheader"><h1 class="p_Heading1" style="page-break-after: avoid;"><span class="f_Heading1">OpenType 布局特征 - Pos 关键字</span></h1>
</div>
<div id="idheader" style="position: relative;">
<div id="idheaderbg">
<table style="width:100%;border:none;margin:0px;" cellspacing="0" cellpadding="0">
 <tbody><tr>
   <td class="topichead" style="text-align:left; vertical-align:bottom">
     <p class="crumbs"><b>导航：</b>&nbsp;编辑字体 &gt; 格式 &gt; OpenType 布局特征 &gt; 脚本编辑器 &gt; 脚本语法 OTLFD &gt;</p>
     <h1 class="p_Heading1" style="page-break-after: avoid;"><span class="f_Heading1">OpenType 布局特征 - Pos 关键字</span></h1>
   </td>
   <td class="topichead" id="idnav">
     <a href="otlf_sub.html" title="上一主题"><span class="hmbtnprev"></span></a>
     <a href="welcometothefontcreator.html" title="返回首章"><span class="hmbtntop"></span></a>
     <a href="otlf_examplesandhelp.html" title="下一主题"><span class="hmbtnnext"></span></a>
   </td>
 </tr>
</tbody></table>
</div>
</div>
<div id="idcontent" style="margin-top: 0px;"><div id="innerdiv">
<!--ZOOMRESTART-->
<p class="p_Normal">关键字 <span style="font-weight:bold;">pos</span> 用于声明字形定位(positioning)。正如所支持的字形定位类型中所述，有几种定位类型。定位声明只能在查询(lookup)中声明，不能直接在特征(feature)中声明定位。每个查询只能有一种定位类型，这意味着如果您想在单个特征中使用多种定位类型，就必须声明多个查询。</p>
<p class="p_Normal">对于大多数定位声明，可以定义几个坐标来确定字形的定位变化。每个声明由一到四个坐标组成。</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">坐标的格式是（包括尖括号）：</p>
<p class="p_Normal">&lt;X预置宽度 Y预置高度 X横向位移 Y纵向位移&gt;</p>
<p class="p_Normal">X预置宽度(XAdvance)必须始终指定，Y预置高度(YAdvance)、X横向位移(XPlacement) 和 Y纵向位移(YPlacement)是可选项。</p>
<p class="p_Normal">&nbsp;</p>
<div style="text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 0.1042in 0;"><table style="border:none;border-spacing:0;">
<tbody><tr>
<td style="vertical-align:top; width:2.0208in; padding:0;border:none"><p class="p_Normal">XAdvance</p>
</td>
<td style="vertical-align:top; width:4.0313in; padding:0;border:none"><p class="p_Normal">预置宽度的水平调整量</p>
</td>
</tr>
<tr>
<td style="vertical-align:top; width:2.0208in; padding:0;border:none"><p class="p_Normal">YAdvance</p>
</td>
<td style="vertical-align:top; width:4.0313in; padding:0;border:none"><p class="p_Normal">预置高度的垂直调整量</p>
</td>
</tr>
<tr>
<td style="vertical-align:top; width:2.0208in; padding:0;border:none"><p class="p_Normal">XPlacement</p>
</td>
<td style="vertical-align:top; width:4.0313in; padding:0;border:none"><p class="p_Normal">放置位置的水平调整量</p>
</td>
</tr>
<tr>
<td style="vertical-align:top; width:2.0208in; padding:0;border:none"><p class="p_Normal">YPlacement</p>
</td>
<td style="vertical-align:top; width:4.0313in; padding:0;border:none"><p class="p_Normal">放置位置的垂直调整量</p>
</td>
</tr>
</tbody></table>
</div>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal"><span style="font-weight:bold;">声明单个调整(类型 1)定位</span></p>
<p class="p_Normal"><a href="fc_automatic_opentype_layout_feat_2_3.html" class="topiclink">单个定位</a>用于更改单个字形或字形类组的位置，可用来轻松创建使用相同字形特征的下标和上标。</p>
<p class="p_Code"><span class="f_Code">lookup MyLookupTable {</span><br>
<span class="f_Code"> &nbsp;pos A &lt;-20 [0 0 0]&gt;;</span><br>
<span class="f_Code">}</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Normal">对于类组，其语法非常相似：</p>
<p class="p_Code"><span class="f_Code">class @class1 [A-Z]</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Code"><span class="f_Code">lookup MyLookupTable {</span><br>
<span class="f_Code"> &nbsp;pos @class1 &lt;-20&gt;</span><br>
<span class="f_Code">}</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Normal"><span style="font-weight:bold;">声明配对调整(类型 2)定位</span></p>
<p class="p_Normal"><a href="fc_automatic_opentype_layout_feat_2_3_2.html" class="topiclink">配对定位</a>用于改变 2 个字形或字形类组的位置，主要用于定义字距调整对子。</p>
<p class="p_Code"><span class="f_Code">lookup MyLookupTable {</span><br>
<span class="f_Code"> &nbsp;pos A B &lt;-10 [0 0 0]&gt; [&lt;0 [0]&gt;];</span><br>
<span class="f_Code">}</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Normal">对于类组，其语法非常相似：</p>
<p class="p_Code"><span class="f_Code">class @class1 [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z]</span></p>
<p class="p_Code"><span class="f_Code">class @class2 [a b c d e f g h i j k l m n o p q r s t u v w x y z]</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Code"><span class="f_Code">lookup MyLookupTable {</span><br>
<span class="f_Code"> &nbsp;pos @class1 @class2 &lt;-20&gt;</span><br>
<span class="f_Code">}</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Normal">上面只用一行代码创建了676个(26&#0215;26)、值为-20的字距调整对子。</p>
<p class="p_Normal">也可以将一个类组与单个字形进行组合：</p>
<p class="p_Code"><span class="f_Code">class @class1 [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z]</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Code"><span class="f_Code">lookup MyLookupTable {</span><br>
<span class="f_Code"> &nbsp;pos @class1 hyphen &lt;-10&gt;</span><br>
<span class="f_Code">}</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Normal">上面只用一行代码创建了值为-10、 大写字母与连字符(hyphen)组合的26个字距调整对子。</p>
<p class="p_Normal"><span style="font-weight:bold;">强制单个调整(类型 1)定位</span></p>
<p class="p_Normal">假如要声明基于类组的字距调整对子，但在导出字体时，需要导出为基于字形的展平式(flattened)字距调整对子，请添加 PairPosFormat1 选项。</p>
<p class="p_Code"><span class="f_Code">lookup MyLookupTable {</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;option PairPosFormat1;</span><br>
<span class="f_Code"> &nbsp;pos @class1 hyphen &lt;-10&gt;</span><br>
<span class="f_Code">}</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Normal"><span style="font-weight:bold;">声明标记到基本(类型 4)的定位</span></p>
<p class="p_Normal">标记到基本(Mark-to-Base)定位，用于通过锚点将标记字形（变音符号）附接(attach)到基本字形上。</p>
<p class="p_Code"><span class="f_Code">lookup MyLookupTable {</span><br>
<span class="f_Code"> &nbsp;mark acute 0 0;</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;mark ring 0 0;</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;pos A mark &nbsp;-10 30;</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;pos B mark -10 20;</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;mark esp 0 0;</span></p>
<p class="p_Code"><span class="f_Code"> &nbsp;pos A mark -10 20;</span><br>
<span class="f_Code">}</span></p>
<p class="p_Code"><span class="f_Code">&nbsp;</span></p>
<p class="p_Normal"><span style="font-weight:bold;">声明标记到标记(类型 6)的定位</span></p>
<p class="p_Normal">标记到标记(Mark-to-Mark)的定位，用来将标记字形附接到其他标记字形上。</p>
<p class="p_Normal">其语法与标记到基本的定位相同，但仅用于标记字形。</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal"><span style="font-weight:bold;">声明链式上下文(类型 8)的定位</span></p>
<p class="p_Normal">此语法与 <a href="otlf_sub.html" class="topiclink">GSUB 语法</a>相同。唯一的区别是，替换表是 GPOS 查询而不是 GSUB 查询。</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<!--ZOOMSTOP-->
</div></div>
<script type="text/javascript">
  $(document).ready(function(){
    $(window).bind('resize', function() {
      var y = $('#idheader').height();
      $('#idcontent').css('margin-top', y);
      var par = window.parent;
      if ($( par ).width()<= $( window ).width()+20) {
        $('#idheader').css('position', 'relative');
        $('#idcontent').css('margin-top', 0);
        $('#idbacktotop').css('display', 'block');
        $('.hmanchor').css('margin-top', -20);
	$('.hmanchor').css('padding-top', 20);
      }
      else {
        $('#idheader').css('position', 'fixed');
        $('#idcontent').css('margin-top', $('#idheader').height());
        $('#idbacktotop').css('display', 'none');
        $('.hmanchor').css('margin-top', -y-20);
	$('.hmanchor').css('padding-top', y+20);
      }
    });
    $(window).resize(); //trigger event for initially small displays
  });
</script>
</body></html>